package com.orderserver;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

/**
 * @Author xiaoxi
 * @ProjectName springclouddemo
 * @PackageName com.orderserver.web
 * @ClassName OrderServerApplication
 * @Description TODO
 * @Date 2022/11/14 14:36
 * @Version 1.0
 */
@SpringBootApplication
@MapperScan("com.orderserver.mapper")
@EnableTransactionManagement
//@EnableEurekaClient
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "feign.usercloud")
public class OrderServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderServerApplication.class, args);
    }

    //spring框架提供的RestTemplate类可用于在应用中调用rest服务，
    // 它简化了与http服务的通信方式，统一了RESTful的标准，
    // 封装了http链接， 我们只需要传入url及返回值类型即可
    // 改用 feign
//    @Bean
//    @LoadBalanced
//    public RestTemplate getRestTemplate() {
//        return new RestTemplate();
//    }

}

